package com.tokenplus.thai.aviewmodel

import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.Transformations
import com.tokenplus.thai.adata.feedback.ReqFeedbackSubmit
import com.tokenplus.thai.base.BaseViewModel
import com.tokenplus.thai.anetwork.ApiUserReposity

class FeedbackViewModel : BaseViewModel() {

    //////////////////////////////////////////
    private val mFeedbackSubmitLiveData = MutableLiveData<ReqFeedbackSubmit>()

    val onFeedbackSubmitLiveData =
        Transformations.switchMap(mFeedbackSubmitLiveData) { query ->
            ApiUserReposity.feedbackSubmit(this, query)
        }

    fun feedbackSubmit(reqFeedbackSubmit: ReqFeedbackSubmit) {
        mFeedbackSubmitLiveData.value = reqFeedbackSubmit
    }
}